package org.budo.canal.util;

import org.budo.support.lang.util.ListUtil;

import com.alibaba.otter.canal.protocol.Message;

/**
 * @author lmw
 */
public class MessageUtil {
    public static String toSimpleString(Message message) {
        if (null == message) {
            return null;
        }

        return message.getClass().getName() + "@" + message.hashCode() //
                + ", id=" + message.getId() + ", entries=" + ListUtil.size(message.getEntries()) + ", rawEntries=" + ListUtil.size(message.getRawEntries());
    }
}